Repository navigation
fix(adapters): refuse LoRA on microscaled layers (mxfp4/mxfp8/nvfp4) naming the mode, until the fork fix is pinned (#746) - #760
Merged
Conversation
…) naming the mode, until the fork's QLoRALinear stops casting its input to uint8 scales (#746) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012cicguZMN3jhNGmf5327oh
goodmai
added a commit
that referenced
this pull request
Nov 24, 2026
…in the fork's QLoRALinear fix (063d9e1), drop the #760 refusal, and test parity against W + s·B·A on the dequantized weights (#746) (#763) Claude-Session: https://claude.ai/code/session_012cicguZMN3jhNGmf5327oh Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #746: the basalt-side refusal. The fork fix is ready, but its pin waits for #739.
Defect
The fork's
QLoRALinear.callAsFunctioncallssuper.callAsFunction(x.asType(scales.dtype)). Onmxfp4,mxfp8andnvfp4the scales areuint8, so the base quantized matmul gets an integer input, not only the LoRA branch. An adapter on such a layer loads without error and gives garbage.QDoRALinear,PHMLinearandOFTLineardo not have the cast.Fix in basalt
MLXInferenceEngine.microscaledLoRARefusal(_:path:)names the layer, its mode and its scale dtype, and cites [P2] adapters: LoRA on mxfp4/mxfp8/nvfp4 bases computes in uint8 (QLoRALinear casts to scales.dtype) #746.--adapterandadapter_apply, throughcheckShapesinattachContainer;adapter_apply;Fork fix, not pinned here
goodmai/mlx-swift-lmbranchbasalt-746-qlora-microscaled, commit 5dd1b94, on top of the current pin e9feb1e. It keeps the input float when the scales are not.Package.swiftis not bumped in this PR. Another session's #733 and #739 hold the fork pin. Once they land, the pin moves to a commit that has this fix, the refusal comes out, and the parity test from #746 is added: mxfp4.qwen35against W + s·B·A on the dequantized weights.Tests
MicroscaledLoRARefusalTestson tiny.qwen35, with the PEFT target layers quantized:adapter_applyare both refused namingmxfp4and#746, and no LoRA layer is left behind.Adapter suites run locally: PEFT, PHM, LabGate, LabTrain, AdapterApply and the new suite. 29 tests, all pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_012cicguZMN3jhNGmf5327oh